#define ElemType int

typedef struct ListNode List_Node;

#include "common.h"

int longestPalindrome(char* s);

int main()
{
	return 0;
}

int longestPalindrome(char* s)
{
	short freq[52] = { 0 };
	for (int i = 0; s[i]; i++)
		if (s[i] >= 'a')
			freq[s[i] - 'a']++;
		else
			freq[s[i] - '\'']++;

	//for (int i = 0; i < 52; i++) {
	//	printf("%d\t", freq[i]);
	//}

	int res = 0, flag = 0;
	for (int i = 0; i < 52; i++) {
		if (freq[i] & 1)
			flag = 1;
		res += freq[i] >> 1;
	}

	res <<= 1;
	return flag ? res + 1 : res;
}
